package com.gxy.learn.backup.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 静态文件读取配置文件
 *
 * @Value方法
 */
@Component
public class ValueStaticConfig {

    private static String userName;

    private static Integer sex;

    private static Integer age;

    @Value("${com.gxy.learn.am.user.userName}")
    public  void setUserName(String userName) {
        ValueStaticConfig.userName = userName;
    }

    @Value("${com.gxy.learn.am.user.sex}")
    public void setSex(Integer sex) {
        ValueStaticConfig.sex = sex;
    }

    @Value("${com.gxy.learn.am.user.age}")
    public void setAge(Integer age) {
        ValueStaticConfig.age = age;
    }

    public static String getUserName() {
        return userName;
    }

    public static Integer getSex() {
        return sex;
    }

    public static Integer getAge() {
        return age;
    }
}
